package last.multicode.fund;

public abstract class Fund {
    int n;
    int num;

    public Fund(int n, int num) {
        this.n = n;
        this.num = num;
    }

    int income() {
        double sum = 0;
        for (int i = 0; i < n; i++) {
            double dValue = value(30) - value(i + 1);
            sum += dValue * num;
        }
        return (int) sum;
    }

    abstract double value(int day);
}
